package org.BattleOfGoode.model;

import java.util.ArrayList;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.view.MotionEvent;

public class BigGoode extends Goode {
	private ArrayList<Goode> goodes = new ArrayList<Goode>();
	private static final int RADIUS = 70;
	private static final int RADIUS_CHILD = 10;
	
	public BigGoode(int x, int y, Bitmap imagem) {
		super(RADIUS, x, y, imagem);	
	}

	// METODOS
	public boolean createGoode(int x, int y) {
		if(RADIUS_CHILD + 5 > this.getRadius()){
			// Can not create a new ball
			return false;
		}
		
		Goode goode = new Goode(RADIUS_CHILD, x, y, this.getBitmap());
		if(this.goodes.add(goode)){ 
			this.grow(-RADIUS_CHILD);
		}
		return true;
	}
	
	@Override
	public void draw(Canvas canvas) {
		// TODO Auto-generated method stub
		super.draw(canvas);
		for (Goode goode : this.goodes) {
			goode.draw(canvas);
		}
	}
	
	public void addGoodes(ArrayList<Goode> goodes) {
		this.goodes.addAll(goodes);
	}

	public void removeAll() {
		this.goodes.clear();
	}

	public void removeGoode(Goode goode) {
		this.goodes.remove(goode);
	}

	// GETS
	public ArrayList<Goode> getGoodes() {
		return this.goodes;
	}
	
	
	public boolean onTouchEvent(MotionEvent event) {
				
		return true;
	}


}
